# Makefile for the interlace demo by Marko Mkel
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

FONTSRC = /usr/lib/kbd/consolefonts/lat1-16.psf
FONT = font.bin
TARGET = interlace.prg
SOURCE = interlace.s

$(TARGET): $(SOURCE) $(FONT)
	dasm $< -o$@

clean:
	rm -f $(FONT)
reallyclean: clean
	rm -f $(TARGET)

$(FONT): $(FONTSRC)
	perl -e 'read STDIN,$$c,0x204;read STDIN,$$d,0x200;read STDIN,$$c,0x200; $$d=$$c.=$$d; $$d =~ s/(.)/pack("C",255-unpack("C", $$1))/ge; $$c .= $$d; $$_ = $$c; s/(.)./$$1/g; print; $$_ = $$c; s/.(.)/$$1/g; print' < $< > $@
